/**
 * 
 */
package com.google.code.netz.wfe.events;

import com.google.code.netz.wfe.model.ICase;

/**
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * @since 1.0
 * @version $Id$
 */
public class CaseEvent<T extends ICase<?>> extends TypedEvent<T> {

	public enum CaseEventType implements IEventType {

		/**
		 * Implies that the ICase has been submitted with the workflow engine
		 * but hasn't been opened yet.
		 */
		CASE_SUBMITTED("Case Submitted"),

		/**
		 * Implies that the ICase submitted with the workflow engine has been
		 * opened.
		 */
		CASE_OPENED("Case Opened"),

		/**
		 * Implies that the ICase opened with the workflow engine has been
		 * closed.
		 */
		CASE_CLOSED("Case Closed"),

		/**
		 * Implies that the execution of an ICase has been suspended.
		 */
		CASE_SUSPENDED("Case Suspended");

		/**
		 * Event type as String.
		 */
		private String type;

		/**
		 * @param type
		 */
		private CaseEventType(String type) {
			this.type = type;
		}

		/**
		 * {@inheritDoc}
		 * 
		 * @see com.google.code.netz.wfe.events.IEventType#asString()
		 */
		@Override
		public String asString() {
			return type;
		}

		/**
		 * {@inheritDoc}
		 * 
		 * @see com.google.code.netz.wfe.events.IEventType#allEventTypes()
		 */
		@Override
		public IEventType[] allEventTypes() {
			return values();
		}

	}

	/**
	 * 
	 * @param source
	 * @param type
	 */
	public CaseEvent(T source, IEventType type) {
		super(source, type);
	}

}
